//
//  DCRCController.m
//  CJPackOCDemo
//
//  Created by 陈警卫 on 2025/7/15.
//

#import "DCRCController.h"
#import "CJPack-Swift.h"

@interface DCRCController ()

@end

@implementation DCRCController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    Byte bytes[3] = {};
    bytes[0] = 0x12;
    bytes[1] = 0x34;
    bytes[2] = 0x56;
    NSData *data = [NSData dataWithBytes:bytes length:sizeof(bytes)];
    
    UInt8 crc8 = [CJCRCHub computeCRC8WithData:data type:CJCRC8TypeAutosar];
    NSString *hex8 = [NSString stringWithFormat:@"%02X", crc8];
    
    UInt16 crc16 = [CJCRCHub computeCRC16WithData:data type:CJCRC16TypeArc];
    NSString *hex16 = [NSString stringWithFormat:@"%02X", crc16];
    
    UInt32 crc32 = [CJCRCHub computeCRC32WithData:data type:CJCRC32TypeAixm];
    NSString *hex32 = [NSString stringWithFormat:@"%02X", crc32];
    
    NSLog(@"%@", hex8);
    NSLog(@"%@", hex16);
    NSLog(@"%@", hex32);
    
    
}



@end
